home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / common.jar / text / common / 01 / 02100001.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  14.1 KB  |  166 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>List of regular expressions</title><meta name="filename" content="text/common/01/02100001"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         table.Tabelle1{
  5.                 }
  6.         span.Tabelle1A{
  7.                 width:3.283cm;}
  8.         span.Tabelle1B{
  9.                 width:14.718cm;}
  10.         td.Tabelle1A1{
  11.                 }
  12.         td.Tabelle1B1{
  13.                 border-width:0.002cm; border-style:solid; border-color:#000000;}
  14.         td.Tabelle1A2{
  15.                 }
  16.         td.Tabelle1B2{
  17.                 }
  18.         p.P1{
  19.                 }
  20.         span.T1{
  21.                 font-weight:bold;}
  22.         </style></head><body>
  23.    
  24.    
  25.    <p class="P1"/>
  26.    <p class="Head1"><help:to-be-embedded Eid="02100001" xmlns:help="http://openoffice.org/2000/help"><help:link Id="68251">List of regular expressions</help:link></help:to-be-embedded></p>
  27.    <p class="Paragraph"/>
  28.    <table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" page-break-inside="page-break-inside:avoid"><tr class=""><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  29.        <p class="TableHead">Character:</p>
  30.       </span></th><th class="Tabelle1B1" style="text-align:left;"><span class="Tabelle1B">
  31.        <p class="TableHead">Result/Use:</p>
  32.       </span></th></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  33.       <p class="TextInTable">.</p>
  34.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  35.       <p class="TextInTable">Stands for any character. The search term "sh.rt" finds both "shirt" and "short"</p>
  36.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  37.       <p class="TextInTable">^Peter</p>
  38.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  39.       <p class="TextInTable">Only finds the word if it appears at the beginning of a paragraph. Special contents (e.g., blank spaces and character-anchored frames) at the beginning of a paragraph will be ignored.</p>
  40.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  41.       <p class="TextInTable">Peter$</p>
  42.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  43.       <p class="TextInTable">Only finds the word if it appears at the end of a paragraph. Special contents (e.g., blank spaces and character-anchored frames) at the end of a paragraph will be ignored.</p>
  44.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  45.       <p class="TextInTable">*</p>
  46.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  47.       <p class="TextInTable">The character in front of it can occur from zero times up to any number of times: For example, "Ab*c" finds "Ac", "Abc", "Abbc", "Abbbc" etc.</p>
  48.       <p class="TextInTable">For "any characters or no characters", the combination .* may be used.</p>
  49.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  50.       <p class="TextInTable">+</p>
  51.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  52.       <p class="TextInTable">The character before this symbol must appear at least once, or in unlimited instances: "AX.+4" finds "AX 4", but not "AX4"</p>
  53.       <p class="TextInTable">The longest possible text within the paragraph is always found. If the paragraph contains the text AX 4 AX4, it will find from the first A to the last 4.</p>
  54.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  55.       <p class="TextInTable">?</p>
  56.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  57.       <p class="TextInTable">The character preceding ? may occur never or only once. "Texts?" finds the words "Text" and "Texts".</p>
  58.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  59.       <p class="TextInTable">\C</p>
  60.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  61.       <p class="TextInTable">Finds precisely this character (no digits), in this case C (if, for example, you want to look for the dollar sign yourself in a regular expression: \$)</p>
  62.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  63.       <p class="TextInTable">\n</p>
  64.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  65.       <p class="TextInTable">Finds a hard row break which has been inserted with Shift+Enter. Use this sign to change row breaks into paragraph breaks. Enter a <span class="T1">\n</span> in the <span class="T1">Search for</span> as well as the <span class="T1">Replace with</span> fields. Now activate the <span class="T1">Replace all</span> button.</p>
  66.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  67.       <p class="TextInTable">\t</p>
  68.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  69.       <p class="TextInTable">Finds a tab space (this expression can also be used in <span class="T1">Replace with</span>)</p>
  70.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  71.       <p class="TextInTable">\></p>
  72.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  73.       <p class="TextInTable">The search term must appear at the end of a word: "book\>" finds "checkbook", but not "bookmark".</p>
  74.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  75.       <p class="TextInTable">\<</p>
  76.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  77.       <p class="TextInTable">The search term must appear at the beginning of a word: "\>book" finds "bookmark", but not "checkbook".</p>
  78.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  79.       <p class="TextInTable">^$</p>
  80.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  81.       <p class="TextInTable">Searches for blank paragraphs.</p>
  82.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  83.       <p class="TextInTable">^.</p>
  84.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  85.       <p class="TextInTable">Searches for the first character of a paragraph.</p>
  86.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  87.       <p class="TextInTable">&</p>
  88.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  89.       <p class="TextInTable">This character in the <span class="T1">Replace with</span> box inserts the find_text.</p>
  90.       <p class="TextInTable">"Window" in the <span class="T1">Search for</span> field and "&frame" in the <span class="T1">Replace with</span> fields returns "window frame" with <span class="T1">Replace</span>.</p>
  91.       <p class="TextInTable">Only enter & in the <span class="T1">Replace with</span> box if you want to apply different <span class="T1">Attributes</span> or a different <span class="T1">Format</span> to the find_text.</p>
  92.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  93.       <p class="TextInTable">[abc123]</p>
  94.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  95.       <p class="TextInTable">Finds all the characters between the brackets</p>
  96.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  97.       <p class="TextInTable">[a-e]</p>
  98.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  99.       <p class="TextInTable">Finds all characters between a and e</p>
  100.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  101.       <p class="TextInTable">[a-eh-x]</p>
  102.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  103.       <p class="TextInTable">Finds all characters between the letters a-e and h-x.</p>
  104.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  105.       <p class="TextInTable">[^a-s]</p>
  106.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  107.       <p class="TextInTable">Finds all characters except for a-s</p>
  108.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  109.       <p class="TextInTable">\xXXXX</p>
  110.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  111.       <p class="TextInTable">Finds the character with the four-digit hexadecimal code XXXX.</p>
  112.       <p class="TextInTable">The number of the character and hence of the code depends on the font used. You can find the codes in <span class="T1">Insert - Special Character</span>.</p>
  113.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  114.       <p class="TextInTable">this|that</p>
  115.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  116.       <p class="TextInTable">Find all "this" and all "that".</p>
  117.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  118.       <p class="TextInTable">{2}</p>
  119.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  120.       <p class="TextInTable">The last character before the opening bracket must appear the number of times indicated by the number in the brackets. 8{2} finds 88.</p>
  121.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  122.       <p class="TextInTable">{1,2}</p>
  123.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  124.       <p class="TextInTable">The last character before the opening bracket must appear the number of times indicated by the numbers in the brackets. 8{1,2} finds 8 and 88.</p>
  125.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  126.       <p class="TextInTable">( )</p>
  127.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  128.       <p class="TextInTable">Use round brackets to define the characters inside the brackets as a reference. Thereafter, you can refer to the first reference in the current expression with \1, to the second reference with \2 and so on.</p>
  129.       <p class="TextInTable">If your text contains the number 13487889 and you search for the regular expression (8)7\1\1, the number 8788 will be found.</p>
  130.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  131.       <p class="TextInTable">[:digit:]?</p>
  132.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  133.       <p class="TextInTable">Finds a number (0 to 9). [:digit:]* finds a sequence of digits.</p>
  134.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  135.       <p class="TextInTable">[:space:]?</p>
  136.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  137.       <p class="TextInTable">Finds whitespace such as spaces and tabs.</p>
  138.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  139.       <p class="TextInTable">[:print:]?</p>
  140.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  141.       <p class="TextInTable">Finds printable characters.</p>
  142.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  143.       <p class="TextInTable">[:cntrl:]?</p>
  144.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  145.       <p class="TextInTable">Finds nonprinting characters.</p>
  146.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  147.       <p class="TextInTable">[:alnum:]?</p>
  148.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  149.       <p class="TextInTable">Finds alphanumeric characters (numbers and letters).</p>
  150.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  151.       <p class="TextInTable">[:alpha:]?</p>
  152.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  153.       <p class="TextInTable">Finds alphabetic characters (letters).</p>
  154.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  155.       <p class="TextInTable">[:lower:]?</p>
  156.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  157.       <p class="TextInTable">Finds lower case letters.</p>
  158.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  159.       <p class="TextInTable">[:upper:]?</p>
  160.      </span></td><td class="Tabelle1B2" style="text-align:left;"><span class="Tabelle1B">
  161.       <p class="TextInTable">Finds upper case letters.</p>
  162.      </span></td></tr></table>
  163.    <p class="Paragraph"><help:switch select="Program" xmlns:help="http://openoffice.org/2000/help"><help:case select="DRAW"/><help:case select="IMPRESS"/><help:default>For a logical search expression with nested AND/OR operators, you can use brackets. For example, " ((a[A-z]*)|(ab[A-z]*)|(b[A-z]*))$" looks for everything beginning with a space and then "a" or "ab" or "b" and stands at the end of a paragraph.</help:default></help:switch></p>
  164.    <p class="ParaList"><help:embedded Id="65598" Eid="related" xmlns:help="http://openoffice.org/2000/help"/></p>
  165.    <p class="ParaList"><help:embedded Id="65852" Eid="02100000" xmlns:help="http://openoffice.org/2000/help"/></p>
  166.   </body></html>